import 'dart:async';
import 'dart:io';

import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';


///test213666
class NativeImagePlugin {
  static const MethodChannel _channel =
      const MethodChannel('native_image_plugin');

  static Future<String> get platformVersion async {
    final String version = await _channel.invokeMethod('getPlatformVersion');
    return version;
  }
}

class NativeImgView extends StatelessWidget{
  final String imgPath;

  NativeImgView(this.imgPath);

  @override
  Widget build(BuildContext context) {
    return _nativeView(imgPath);
  }

}


_nativeView(String imgPath){
  Widget view;
  if(Platform.isAndroid){
    view = AndroidView(viewType: "native_img",creationParams:{"imgPath":imgPath} ,creationParamsCodec: StandardMessageCodec(),);
  }else if(Platform.isIOS){
    view = Container();
  }
  return view;
}

